package demo3;

import java.util.LinkedList;
import java.util.List;

public class Test {


    private static MyLinkedList linkedList = new MyLinkedList();


    public static void main(String[] args) {
        List<Integer> list = new LinkedList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        System.out.println(list);

    }





    public static void main1(String[] args) {
        ListNode node1 = new ListNode(1);
        ListNode node2 = new ListNode(2);
        ListNode node3 = new ListNode(3);
        ListNode node4 = new ListNode(4);
        ListNode node5 = new ListNode(5);
        ListNode node6 = new ListNode(6);


//        node6.prev = node5;
//        node5.prev = node4;
//        node4.prev = node3;
//        node3.prev = node2;
//        node2.prev = node1;
//        node1.prev = null;
//
//
//        node1.next = node2;
//        node2.next = node3;
//        node3.next = node4;
//        node4.next = node5;
//        node5.next = node6;
//        node6.next = null;
//        head = node1;
//        last = node6;


        MyLinkedList.head = null;
        MyLinkedList.last = null;


//        linkedList.display(MyLinkedList.head);
//        System.out.println(linkedList.size(head));
//        System.out.println(linkedList.contains(5,head));
        linkedList.addFirst(5);
        linkedList.addFirst(4);
        linkedList.addFirst(1);
        linkedList.addFirst(1);
        linkedList.addFirst(1);


//        linkedList.display(MyLinkedList.head);
        linkedList.display(MyLinkedList.head);
//        linkedList.remove(5);
        linkedList.clear();
        linkedList.display(MyLinkedList.head);



    }








}
